package com.dc.project.entity.vo;

import com.dc.project.entity.po.UserVolcengine;
import com.own.component.common.base.entity.vo.BaseVo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * UserVolcengineVo
 *
 * @author chenxueli
 * @date 2025-04-25 11:33:04
 */
@Schema(title = "用户大模型配置" + ConstantBeanSuffix.VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class UserVolcengineVo extends BaseVo<UserVolcengine> implements Serializable {

    @Schema(title = "用户id")
    private Long userId;

    @Schema(title = "基础url")
    private String baseUrl;

    @Schema(title = "api key")
    private String apiKey;

    @Schema(title = "模型id")
    private String modelId;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public UserVolcengineVo(@NonNull UserVolcengine entity) {
        super(entity);
        this.userId = entity.getFkUserId();
        this.baseUrl = entity.getBaseUrl();
        this.apiKey = entity.getApiKey();
        this.modelId = entity.getModelId();
    }

    /**
     * 转po对象
     *
     * @param entity 原对象
     * @return po对象
     */
    @Override
    public UserVolcengine toPo(UserVolcengine entity) {
        if (entity == null) {
            entity = new UserVolcengine();
        }
        entity.setFkUserId(this.userId);
        entity.setBaseUrl(this.baseUrl);
        entity.setApiKey(this.apiKey);
        entity.setModelId(this.modelId);
        return super.toPo(entity);
    }

}
